<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input id="wd" placeholder="请您输入英文"/>
		<input type="button" onclick="chaDanCi()" value="查单词" />
		<script>
			var chinese=["猫","狗","猪"];
			var English=["cat","dog","pig"];
			var chaDanCi=function(){
				var word=wd.value;
				var isFind=false;
				for(var i=0;i<word.length;i++){
					if(English[i]==word){
						alert(chinese[i]);
						isFind=true;
					}
				}
				if(!isFind){
				alert("没有该单词");
				}
			}
			
		</script>
	</body>
</html>
